package cn.com.service.impl;

import cn.com.beans.News;
import cn.com.mapper.NewsMapper;
import cn.com.service.NewsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class NewsServiceImpl implements NewsService {

    @Resource
    private NewsMapper newsMapper;

    @Override
    public int deleteByPrimaryKey(Integer nId) {
        return newsMapper.deleteByPrimaryKey(nId);
    }

    @Override
    public boolean insert(News record) {
        return newsMapper.insert(record)>0;
    }

    @Override
    public int insertSelective(News record) {
        return newsMapper.insertSelective(record);
    }

    @Override
    public News selectByPrimaryKey(Integer nId) {
        return newsMapper.selectByPrimaryKey(nId);
    }

    @Override
    public int updateByPrimaryKeySelective(News record) {
        return newsMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(News record) {
        return newsMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<News> findAllNews() {
        return newsMapper.findAllnews();
    }

    @Override
    public News findNewById(Integer nid) {
        return newsMapper.findNewById(nid);
    }

    @Override
    public List<News> findNewsByType(Integer nCategory) {
        return newsMapper.findNewsByType(nCategory);
    }

}

